package ch6;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Zhishu {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("请输入一个数：");

        int num = in.nextInt();
        int i = 2;
        while (i*i<num &&num%i!=0){
            i++;
        }
        if(i*i>num &&num!=1){
            System.out.println(num+"是质数");
        }else{
            System.out.println(num+"不是质数");
        }
    }
}
